using UnityEngine;

namespace Coffee.UIExtensions
{
    // [Assembly-CSharp.dll].Coffee.UIExtensions.UIEffectCapturedImage
    public class UIEffectCapturedImage : RawImage
    {
        
        #region Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate
        // [Assembly-CSharp.dll].Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate
        public enum DesamplingRate
        {
            // Fields
            None = 0
            ,x1 = 1
            ,x2 = 2
            ,x4 = 4
            ,x8 = 8
            
        
        }
        
        #endregion
        
        
        #region Coffee.UIExtensions.UIEffectCapturedImage.<_CoUpdateTextureOnNextFrame>d__96
        // [Assembly-CSharp.dll].Coffee.UIExtensions.UIEffectCapturedImage.<_CoUpdateTextureOnNextFrame>d__96
        private sealed class __CoUpdateTextureOnNextFrame_d__96 : IEnumerator<object>, IEnumerator, IDisposable
        {
            // Fields
            private int __1__state;
            private object __2__current;
            public Coffee.UIExtensions.UIEffectCapturedImage __4__this;
            
            // Properties
            private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
            private object System.Collections.IEnumerator.Current { get; }
            
            // Methods
            public __CoUpdateTextureOnNextFrame_d__96(int __1__state)
            {
                this.__1__state = __1__state;
            }
            private void System.IDisposable.Dispose()
            {
            
            }
            private bool MoveNext()
            {
                if(this.__1__state != 1)
                {
                        if(this.__1__state != 0)
                {
                        return false;
                }
                
                    this.__1__state = 0;
                    UnityEngine.WaitForEndOfFrame val_1 = 536895817;
                    val_1 = new UnityEngine.WaitForEndOfFrame();
                    this.__2__current = val_1;
                    this.__1__state = 1;
                    return false;
                }
                
                this.__1__state = 0;
                this.__4__this.UpdateTexture();
                return false;
            }
            private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
            {
                return (object)this.__2__current;
            }
            private void System.Collections.IEnumerator.Reset()
            {
                27351792 = new System.NotSupportedException();
                throw 27351792;
            }
            private object System.Collections.IEnumerator.get_Current()
            {
                return (object)this.__2__current;
            }
        
        }
        
        #endregion
        
        // Fields
        public const string shaderName = "UI/Hidden/UI-EffectCapture";
        private float m_EffectFactor;
        private float m_ColorFactor;
        private float m_BlurFactor;
        private Coffee.UIExtensions.EffectMode m_EffectMode;
        private Coffee.UIExtensions.ColorMode m_ColorMode;
        private Coffee.UIExtensions.BlurMode m_BlurMode;
        private UnityEngine.Color m_EffectColor;
        private Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate m_DesamplingRate;
        private Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate m_ReductionRate;
        private UnityEngine.FilterMode m_FilterMode;
        private UnityEngine.Material m_EffectMaterial;
        private int m_BlurIterations;
        private bool m_FitToScreen;
        private bool m_CaptureOnEnable;
        private bool m_ImmediateCapturing;
        private UnityEngine.RenderTexture _rt;
        private UnityEngine.Rendering.RenderTargetIdentifier _rtId;
        private static int s_CopyId;
        private static int s_EffectId1;
        private static int s_EffectId2;
        private static int s_EffectFactorId;
        private static int s_ColorFactorId;
        private static UnityEngine.Rendering.CommandBuffer s_CommandBuffer;
        
        // Properties
        public float toneLevel { get; set; }
        public float effectFactor { get; set; }
        public float colorFactor { get; set; }
        public float blur { get; set; }
        public float blurFactor { get; set; }
        public Coffee.UIExtensions.EffectMode toneMode { get; }
        public Coffee.UIExtensions.EffectMode effectMode { get; }
        public Coffee.UIExtensions.ColorMode colorMode { get; }
        public Coffee.UIExtensions.BlurMode blurMode { get; }
        public UnityEngine.Color effectColor { get; set; }
        public virtual UnityEngine.Material effectMaterial { get; }
        public Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate desamplingRate { get; set; }
        public Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate reductionRate { get; set; }
        public UnityEngine.FilterMode filterMode { get; set; }
        public UnityEngine.RenderTexture capturedTexture { get; }
        public int iterations { get; set; }
        public int blurIterations { get; set; }
        public bool keepCanvasSize { get; set; }
        public bool fitToScreen { get; set; }
        public UnityEngine.RenderTexture targetTexture { get; set; }
        public bool captureOnEnable { get; set; }
        public bool immediateCapturing { get; set; }
        
        // Methods
        public float get_toneLevel()
        {
            return (float)this.m_EffectFactor;
        }
        public void set_toneLevel(float value)
        {
            this.m_EffectFactor = (value >= 0) ? value : 0f;
        }
        public float get_effectFactor()
        {
            return (float)this.m_EffectFactor;
        }
        public void set_effectFactor(float value)
        {
            this.m_EffectFactor = (value >= 0) ? value : 0f;
        }
        public float get_colorFactor()
        {
            return (float)this.m_ColorFactor;
        }
        public void set_colorFactor(float value)
        {
            this.m_ColorFactor = (value >= 0) ? value : 0f;
        }
        public float get_blur()
        {
            return (float)this.m_BlurFactor;
        }
        public void set_blur(float value)
        {
            this.m_BlurFactor = (value >= 0) ? value : 0f;
        }
        public float get_blurFactor()
        {
            return (float)this.m_BlurFactor;
        }
        public void set_blurFactor(float value)
        {
            this.m_BlurFactor = (value >= 0) ? value : 0f;
        }
        public Coffee.UIExtensions.EffectMode get_toneMode()
        {
            return (Coffee.UIExtensions.EffectMode)this.m_EffectMode;
        }
        public Coffee.UIExtensions.EffectMode get_effectMode()
        {
            return (Coffee.UIExtensions.EffectMode)this.m_EffectMode;
        }
        public Coffee.UIExtensions.ColorMode get_colorMode()
        {
            return (Coffee.UIExtensions.ColorMode)this.m_ColorMode;
        }
        public Coffee.UIExtensions.BlurMode get_blurMode()
        {
            return (Coffee.UIExtensions.BlurMode)this.m_BlurMode;
        }
        public UnityEngine.Color get_effectColor()
        {
            return new UnityEngine.Color() {r = this.m_EffectColor};
        }
        public void set_effectColor(UnityEngine.Color value)
        {
            this.m_EffectColor = value;
            mem[1152921504930430660] = value.g;
            mem[1152921504930430664] = value.b;
            mem[1152921504930430668] = value.a;
        }
        public virtual UnityEngine.Material get_effectMaterial()
        {
            return (UnityEngine.Material)this.m_EffectMaterial;
        }
        public Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate get_desamplingRate()
        {
            return (Coffee.UIExtensions.UIEffectCapturedImage.Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate)this.m_DesamplingRate;
        }
        public void set_desamplingRate(Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate value)
        {
            this.m_DesamplingRate = value;
        }
        public Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate get_reductionRate()
        {
            return (Coffee.UIExtensions.UIEffectCapturedImage.Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate)this.m_ReductionRate;
        }
        public void set_reductionRate(Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate value)
        {
            this.m_ReductionRate = value;
        }
        public UnityEngine.FilterMode get_filterMode()
        {
            return (UnityEngine.FilterMode)this.m_FilterMode;
        }
        public void set_filterMode(UnityEngine.FilterMode value)
        {
            this.m_FilterMode = value;
        }
        public UnityEngine.RenderTexture get_capturedTexture()
        {
            return (UnityEngine.RenderTexture)this._rt;
        }
        public int get_iterations()
        {
            return (int)this.m_BlurIterations;
        }
        public void set_iterations(int value)
        {
            this.m_BlurIterations = value;
        }
        public int get_blurIterations()
        {
            return (int)this.m_BlurIterations;
        }
        public void set_blurIterations(int value)
        {
            this.m_BlurIterations = value;
        }
        public bool get_keepCanvasSize()
        {
            return (bool)this.m_FitToScreen;
        }
        public void set_keepCanvasSize(bool value)
        {
            this.m_FitToScreen = value;
        }
        public bool get_fitToScreen()
        {
            return (bool)this.m_FitToScreen;
        }
        public void set_fitToScreen(bool value)
        {
            this.m_FitToScreen = value;
        }
        public UnityEngine.RenderTexture get_targetTexture()
        {
            return 0;
        }
        public void set_targetTexture(UnityEngine.RenderTexture value)
        {
        
        }
        public bool get_captureOnEnable()
        {
            return (bool)this.m_CaptureOnEnable;
        }
        public void set_captureOnEnable(bool value)
        {
            this.m_CaptureOnEnable = value;
        }
        public bool get_immediateCapturing()
        {
            return (bool)this.m_ImmediateCapturing;
        }
        public void set_immediateCapturing(bool value)
        {
            this.m_ImmediateCapturing = value;
        }
        protected override void OnEnable()
        {
            this.OnEnable();
            if(this.m_CaptureOnEnable == false)
            {
                    return;
            }
            
            if(UnityEngine.Application.isPlaying == false)
            {
                    return;
            }
            
            this.Capture();
        }
        protected override void OnDisable()
        {
            this.OnDisable();
            if(this.m_CaptureOnEnable == false)
            {
                    return;
            }
            
            if(UnityEngine.Application.isPlaying == false)
            {
                    return;
            }
            
            this._Release(releaseRT:  false);
            this.texture = 0;
        }
        protected override void OnDestroy()
        {
            this._Release(releaseRT:  true);
            this.texture = 0;
            this.OnDestroy();
        }
        protected override void OnPopulateMesh(UnityEngine.UI.VertexHelper vh)
        {
            var val_21;
            float val_29;
            var val_30;
            float val_31;
            float val_32;
            var val_33;
            float val_34;
            float val_35;
            var val_36;
            float val_37;
            float val_38;
            var val_39;
            float val_40;
            if(27351912 != 0)
            {
                    UnityEngine.Color val_2 = this.color;
                if(val_2.a >= 0)
            {
                    if(this.canvasRenderer.GetAlpha() >= 0)
            {
                goto label_5;
            }
            
            }
            
            }
            
            vh.Clear();
            return;
            label_5:
            this.OnPopulateMesh(vh:  vh);
            int val_5 = vh.currentVertCount;
            UnityEngine.Color val_6 = this.color;
            if(val_5 < 1)
            {
                    return;
            }
            
            float val_29 = 255f;
            val_6.r = val_6.r * val_29;
            float val_7 = (val_6.r >= 0) ? (val_6.r) : 0f;
            float val_8 = val_7 + 0.5f;
            float val_10 = val_7 + (-0.5f);
            float val_11 = (val_6.g >= 0) ? (S16 * val_29) : 0f;
            float val_12 = val_11 + 0.5f;
            float val_14 = val_11 + (-0.5f);
            float val_15 = (val_6.b >= 0) ? (S17 * val_29) : 0f;
            float val_16 = val_15 + 0.5f;
            val_29 = 1f * val_29;
            float val_17 = val_15 + (-0.5f);
            float val_18 = (val_6.a >= 0) ? (val_29) : 0f;
            float val_19 = val_18 + 0.5f;
            float val_20 = val_18 + (-0.5f);
            var val_31 = 0;
            label_25:
            vh.PopulateUIVertex(vertex:  new UnityEngine.UIVertex() {position = new UnityEngine.Vector3() {x = 0f, y = 0f, z = 0f}, normal = new UnityEngine.Vector3() {x = 0f, y = 0f, z = 0f}, tangent = new UnityEngine.Vector4() {x = 0f, y = 0f, z = 0f, w = 0f}, color = new UnityEngine.Color32(), uv0 = new UnityEngine.Vector4() {x = 0f, y = 0f, z = 0f, w = 0f}, uv1 = new UnityEngine.Vector4() {x = 0f, y = 0f, z = 0f, w = 0f}, uv2 = new UnityEngine.Vector4() {x = 0f, y = 0f, z = 0f, w = 0f}, uv3 = new UnityEngine.Vector4() {x = 0f, y = 0f, z = 0f, w = 0f}}, i:  0);
            if(val_7 >= 0f)
            {
                goto label_9;
            }
            
            val_29 = val_8;
            if((double)val_7 != (-0.5))
            {
                goto label_12;
            }
            
            val_30 = val_21;
            val_31 = -1f;
            goto label_11;
            label_9:
            val_29 = val_8;
            if((double)val_7 != 0.5)
            {
                goto label_12;
            }
            
            val_30 = val_21;
            val_31 = 1f;
            label_11:
            val_31 = (float)val_30 + val_31;
            float val_22 = (((long)val_30 & 1) != 0) ? ((float)val_30) : (val_31);
            label_12:
            if(val_11 >= 0f)
            {
                goto label_13;
            }
            
            val_32 = val_12;
            if((double)val_11 != (-0.5))
            {
                goto label_16;
            }
            
            val_33 = val_21;
            val_34 = -1f;
            goto label_15;
            label_13:
            val_32 = val_12;
            if((double)val_11 != 0.5)
            {
                goto label_16;
            }
            
            val_33 = val_21;
            val_34 = 1f;
            label_15:
            val_34 = (float)val_33 + val_34;
            float val_23 = (((long)val_33 & 1) != 0) ? ((float)val_33) : (val_34);
            label_16:
            if(val_15 >= 0f)
            {
                goto label_17;
            }
            
            val_35 = val_16;
            if((double)val_15 != (-0.5))
            {
                goto label_20;
            }
            
            val_36 = val_21;
            val_37 = -1f;
            goto label_19;
            label_17:
            val_35 = val_16;
            if((double)val_15 != 0.5)
            {
                goto label_20;
            }
            
            val_36 = val_21;
            val_37 = 1f;
            label_19:
            val_37 = (float)val_36 + val_37;
            float val_24 = (((long)val_36 & 1) != 0) ? ((float)val_36) : (val_37);
            label_20:
            if(val_18 >= 0f)
            {
                goto label_21;
            }
            
            val_38 = val_19;
            if((double)val_18 != (-0.5))
            {
                goto label_24;
            }
            
            val_39 = val_21;
            val_40 = -1f;
            goto label_23;
            label_21:
            val_38 = val_19;
            if((double)val_18 != 0.5)
            {
                goto label_24;
            }
            
            val_39 = val_21;
            val_40 = 1f;
            label_23:
            float val_30 = (float)val_39;
            val_40 = val_30 + val_40;
            val_30 = (((long)val_39 & 1) != 0) ? (val_30) : (val_40);
            label_24:
            var val_25 = (val_22 < 0) ? ((int)val_22) : ((int)val_22);
            var val_26 = (val_23 < 0) ? ((int)val_23) : ((int)val_23);
            val_26 = val_26 & 255;
            var val_27 = (val_24 < 0) ? ((int)val_24) : ((int)val_24);
            val_27 = val_27 & 255;
            var val_28 = (val_30 < 0) ? ((int)val_30) : ((int)val_30);
            vh.SetUIVertex(vertex:  new UnityEngine.UIVertex() {position = new UnityEngine.Vector3(), normal = new UnityEngine.Vector3(), tangent = new UnityEngine.Vector4(), color = new UnityEngine.Color32(), uv0 = new UnityEngine.Vector4(), uv1 = new UnityEngine.Vector4(), uv2 = new UnityEngine.Vector4(), uv3 = new UnityEngine.Vector4()}, i:  0);
            val_31 = val_31 + 1;
            if(val_5 != val_31)
            {
                goto label_25;
            }
        
        }
        public void GetDesamplingSize(Coffee.UIExtensions.UIEffectCapturedImage.DesamplingRate rate, [Out] int w, [Out] int h)
        {
            var val_8;
            var val_9;
            var val_10;
            val_8 = h;
            val_9 = w;
            mem2[0] = UnityEngine.Screen.width;
            int val_2 = UnityEngine.Screen.height;
            mem2[0] = val_2;
            if(rate == 0)
            {
                    return;
            }
            
            float val_3 = (float)val_9 / (float)val_2;
            if(val_9 >= val_2)
            {
                goto label_1;
            }
            
            val_2 = val_2 / rate;
            int val_4 = UnityEngine.Mathf.ClosestPowerOfTwo(value:  val_2);
            mem2[0] = val_4;
            val_10 = val_3 * (float)val_4;
            if(mem[536889581] != 0)
            {
                goto label_4;
            }
            
            goto label_4;
            label_1:
            int val_6 = UnityEngine.Mathf.ClosestPowerOfTwo(value:  val_9 / rate);
            mem2[0] = val_6;
            val_10 = (float)val_6 / val_3;
            val_9 = val_8;
            label_4:
            mem2[0] = ((float)val_2 == Infinityf) ? -2147483648 : (W9);
        }
        public void Capture()
        {
            if(this.m_FitToScreen != false)
            {
                    UnityEngine.Transform val_3 = this.canvas.rootCanvas.transform;
                UnityEngine.Rect val_4 = val_3.rect;
                UnityEngine.Vector2 val_5 = val_4.m_XMin.size;
                this.rectTransform.SetSizeWithCurrentAnchors(axis:  0, size:  val_4.m_XMin);
                this.rectTransform.SetSizeWithCurrentAnchors(axis:  1, size:  val_4.m_YMin);
                UnityEngine.Vector3 val_9 = val_3.position;
                this.rectTransform.position = new UnityEngine.Vector3() {x = val_9.x, y = val_9.y, z = val_9.z};
            }
            
            if(mem[536894981] == 0)
            {
                    mem2[0] = UnityEngine.Shader.PropertyToID(name:  -1610600713);
                mem2[0] = UnityEngine.Shader.PropertyToID(name:  -1610600717);
                mem2[0] = UnityEngine.Shader.PropertyToID(name:  -1610600715);
                mem2[0] = UnityEngine.Shader.PropertyToID(name:  -1610600839);
                mem2[0] = UnityEngine.Shader.PropertyToID(name:  -1610600849);
                UnityEngine.Rendering.CommandBuffer val_15 = 536883981;
                val_15 = new UnityEngine.Rendering.CommandBuffer();
                mem2[0] = val_15;
            }
            
            mem[536894981] + 24.GetDesamplingSize(rate:  this.m_DesamplingRate, w:  323570972, h:  323570968);
            if((UnityEngine.Object.op_Implicit(exists:  this._rt)) != false)
            {
                    if(mem[this._rt] == 0)
            {
                    if(mem[this._rt] == 0)
            {
                goto label_16;
            }
            
            }
            
                mem[this._rt]._Release(obj:  this._rt);
            }
            
            label_16:
            if(mem[this._rt] == 0)
            {
                    mem2[0] = UnityEngine.RenderTexture.GetTemporary(width:  0, height:  0, depthBuffer:  0, format:  0, readWrite:  0);
                mem[this._rt].filterMode = this.m_FilterMode;
                this._rt.useMipMap = false;
                mem[this._rt].wrapMode = 1;
                UnityEngine.Rendering.RenderTargetIdentifier val_19 = new UnityEngine.Rendering.RenderTargetIdentifier(tex:  this._rt);
                m_DepthSlice = val_19.m_CubeFace;
                mem2[0] = val_19.m_Type;
                m_BufferPointer = val_19.m_BufferPointer;
            }
            
            this.SetupCommandBuffer();
        }
        private void SetupCommandBuffer()
        {
            UnityEngine.Rendering.BuiltinRenderTextureType val_5;
            IntPtr val_6;
            UnityEngine.CubemapFace val_7;
            UnityEngine.Rendering.BuiltinRenderTextureType val_9;
            IntPtr val_10;
            UnityEngine.CubemapFace val_11;
            UnityEngine.Rendering.BuiltinRenderTextureType val_13;
            IntPtr val_14;
            UnityEngine.CubemapFace val_15;
            UnityEngine.Rendering.BuiltinRenderTextureType val_17;
            IntPtr val_18;
            UnityEngine.CubemapFace val_19;
            int val_30;
            var val_32;
            var val_33;
            var val_34;
            if((mem[536894981] + 24) == 0)
            {
                    UnityEngine.Rendering.CommandBuffer val_1 = 536883981;
                val_1 = new UnityEngine.Rendering.CommandBuffer();
                mem2[0] = val_1;
            }
            
            int val_2 = UnityEngine.Screen.width;
            int val_3 = UnityEngine.Screen.height;
            mem[536894981] + 24.GetTemporaryRT(nameID:  mem[536894981], width:  val_2, height:  val_3, depthBuffer:  0, filter:  this.m_FilterMode);
            UnityEngine.Rendering.RenderTargetIdentifier val_4 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(type:  0);
            UnityEngine.Rendering.RenderTargetIdentifier val_8 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981]);
            val_5 = val_9;
            val_6 = val_10;
            val_7 = val_11;
            mem[536894981] + 24.Blit(source:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_5, m_NameID = val_5, m_InstanceID = val_5, m_BufferPointer = val_6, m_MipLevel = val_6, m_CubeFace = val_7}, dest:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_5, m_NameID = val_5, m_InstanceID = val_5, m_BufferPointer = val_6, m_MipLevel = val_6, m_CubeFace = val_7});
            mem[536894981] + 24.SetGlobalVector(nameID:  mem[536894981] + 12, value:  new UnityEngine.Vector4() {x = this.m_EffectFactor, y = 0f, z = 0f, w = 0f});
            mem[536894981] + 24.SetGlobalVector(nameID:  mem[536894981] + 16, value:  new UnityEngine.Vector4() {x = this.m_EffectColor, y = 0f, z = 0f, w = 0f});
            mem[536894981] + 24.GetDesamplingSize(rate:  this.m_ReductionRate, w:  323570972, h:  323570968);
            val_30 = val_3;
            mem[536894981] + 24.GetTemporaryRT(nameID:  mem[536894981] + 4, width:  val_2, height:  val_30, depthBuffer:  0, filter:  this.m_FilterMode);
            UnityEngine.Rendering.RenderTargetIdentifier val_12 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981]);
            val_9 = val_13;
            val_10 = val_14;
            val_11 = val_15;
            UnityEngine.Rendering.RenderTargetIdentifier val_16 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981] + 4);
            val_13 = val_17;
            val_14 = val_18;
            val_15 = val_19;
            mem[536894981] + 24.Blit(source:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_9, m_NameID = val_9, m_InstanceID = val_9, m_BufferPointer = val_10, m_MipLevel = val_10, m_CubeFace = val_11}, dest:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_13, m_NameID = val_13, m_InstanceID = val_13, m_BufferPointer = val_14, m_MipLevel = val_14, m_CubeFace = val_15}, mat:  this.m_EffectMaterial, pass:  0);
            mem[536894981] + 24.ReleaseTemporaryRT(nameID:  mem[536894981]);
            if(this.m_BlurMode != 0)
            {
                    mem[536894981] + 24.GetTemporaryRT(nameID:  mem[536894981] + 8, width:  val_2, height:  val_30, depthBuffer:  0, filter:  this.m_FilterMode);
                val_32 = mem[536894981];
                val_33 = mem[mem[536894981] + 24];
                val_33 = mem[536894981] + 24;
                if(this.m_BlurIterations >= 1)
            {
                    do
            {
                val_33.SetGlobalVector(nameID:  mem[536894981] + 12, value:  new UnityEngine.Vector4() {x = this.m_BlurFactor, y = 0f, z = 0f, w = 0f});
                UnityEngine.Rendering.RenderTargetIdentifier val_20 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981] + 4);
                UnityEngine.Rendering.RenderTargetIdentifier val_21 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981] + 8);
                val_5 = val_9;
                val_6 = val_10;
                val_7 = val_11;
                mem[536894981] + 24.Blit(source:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_5, m_NameID = val_5, m_InstanceID = val_5, m_BufferPointer = val_6, m_MipLevel = val_6, m_CubeFace = val_7}, dest:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_5, m_NameID = val_5, m_InstanceID = val_5, m_BufferPointer = val_6, m_MipLevel = val_6, m_CubeFace = val_7}, mat:  this.m_EffectMaterial, pass:  1);
                mem[536894981] + 24.SetGlobalVector(nameID:  mem[536894981] + 12, value:  new UnityEngine.Vector4() {x = 0f, y = this.m_BlurFactor, z = 0f, w = 0f});
                UnityEngine.Rendering.RenderTargetIdentifier val_22 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981] + 8);
                val_9 = val_13;
                val_10 = val_14;
                val_11 = val_15;
                UnityEngine.Rendering.RenderTargetIdentifier val_23 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981] + 4);
                val_13 = val_17;
                val_14 = val_18;
                val_15 = val_19;
                mem[536894981] + 24.Blit(source:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_9, m_NameID = val_9, m_InstanceID = val_9, m_BufferPointer = val_10, m_MipLevel = val_10, m_CubeFace = val_11}, dest:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_13, m_NameID = val_13, m_InstanceID = val_13, m_BufferPointer = val_14, m_MipLevel = val_14, m_CubeFace = val_15}, mat:  this.m_EffectMaterial, pass:  1);
                val_30 = 0 + 1;
                val_32 = mem[536894981];
                val_33 = mem[mem[536894981] + 24];
                val_33 = mem[536894981] + 24;
            }
            while(val_30 < this.m_BlurIterations);
            
            }
            
                val_33.ReleaseTemporaryRT(nameID:  mem[536894981] + 8);
            }
            
            val_34 = mem[mem[536894981] + 24];
            val_34 = mem[536894981] + 24;
            UnityEngine.Rendering.RenderTargetIdentifier val_24 = UnityEngine.Rendering.RenderTargetIdentifier.op_Implicit(nameID:  mem[536894981] + 4);
            val_7 = this._rtId.m_DepthSlice;
            val_5 = this._rtId.m_Type;
            val_6 = this._rtId.m_BufferPointer;
            val_34.Blit(source:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_5, m_NameID = val_5, m_InstanceID = val_5, m_BufferPointer = val_6, m_MipLevel = val_6, m_CubeFace = val_7}, dest:  new UnityEngine.Rendering.RenderTargetIdentifier() {m_Type = val_5, m_NameID = val_5, m_InstanceID = val_5, m_BufferPointer = val_6, m_CubeFace = val_7});
            mem[536894981] + 24.ReleaseTemporaryRT(nameID:  mem[536894981] + 4);
            if(this.m_ImmediateCapturing != false)
            {
                    this.UpdateTexture();
                return;
            }
            
            val_34 = this.canvas.rootCanvas.GetComponent<System.Object>();
            UnityEngine.Coroutine val_29 = val_34.StartCoroutine(routine:  this._CoUpdateTextureOnNextFrame());
        }
        public void Release()
        {
            this._Release(releaseRT:  true);
            this.texture = 0;
        }
        private void _Release(bool releaseRT)
        {
            if(releaseRT != false)
            {
                    this.texture = 0;
                this._Release(obj:  this._rt);
            }
            
            if((mem[536894981] + 24) == 0)
            {
                    return;
            }
            
            mem[536894981] + 24.Clear();
            if(releaseRT == false)
            {
                    return;
            }
            
            mem[536894981] + 24.Release();
            mem2[0] = 0;
            this = ???;
        }
        private void _SetDirty()
        {
        
        }
        private void _Release(UnityEngine.RenderTexture obj)
        {
            var val_6;
            if((UnityEngine.Object.op_Implicit(exists:  1152921504808710144)) == false)
            {
                    return;
            }
            
            1152921504808710144.Release();
            UnityEngine.RenderTexture.ReleaseTemporary(temp:  null);
            mem2[0] = 0;
            val_6 = ???;
        }
        private System.Collections.IEnumerator _CoUpdateTextureOnNextFrame()
        {
            object val_1 = 536901065;
            val_1 = new System.Object();
            mem[536901081] = 0;
            mem[536901097] = this;
            return (System.Collections.IEnumerator)val_1;
        }
        private void UpdateTexture()
        {
            UnityEngine.Graphics.ExecuteCommandBuffer(buffer:  mem[536894981] + 24);
            this._Release(releaseRT:  false);
            this.texture = this._rt;
        }
        public UIEffectCapturedImage()
        {
            this.m_EffectFactor = 1;
            this.m_EffectColor = 1;
            this.m_BlurFactor = 1f;
            this.m_BlurMode = 3;
            this.m_DesamplingRate = 1;
            this.m_FilterMode = 1;
            this.m_BlurIterations = 3;
            this.m_FitToScreen = true;
            this.m_ImmediateCapturing = true;
        }
    
    }

}
